<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>定时跳转页面</title>
    <script>

        let interId;

        onload =function () {

            interId =setInterval(changeTime,1000);

        }
        let time=3;
        function changeTime(){
            time--;
            let sObj=document.getElementById("sId");
            sObj.innerText=time;
            if(time==0){

                clearInterval(interId);

            location.href="http://www.baidu.com";
            }
        }
    </script>
</head>

<body>

<h2>支付成昆,<span id="sId">3</span>秒后跳转到百度搜索</h2>

</body>
</html>